//
//  UIScrollView+Extensions.m
//  mobile
//
//  Created by Demi on 10/03/2017.
//  Copyright © 2017 azazie. All rights reserved.
//

#import "UIScrollView+Extensions.h"

@implementation UIScrollView (Extensions)

- (NSInteger)tx_horizontalPage
{
    CGFloat width = self.bounds.size.width;
    CGFloat offsetX = self.contentOffset.x;
    if (offsetX <= 0)
    {
        return 0;
    }
    CGFloat page = offsetX / width;
    return round(page);
}

@end
